package model;

public class DVD extends Resource {
    private final String director;
    private final int duration; // 分钟
    private final int releaseYear;
    private static final int LOAN_PERIOD = 7; // 7天借阅期

    public DVD(String id, String title, String director, int duration, int releaseYear) {
        super(id, title);
        this.director = director;
        this.duration = duration;
        this.releaseYear = releaseYear;
    }

    @Override
    public String getDetails() {
        return String.format("DVD: %s\nDirector: %s\nDuration: %d min\nYear: %d\nID: %s",
                getTitle(), director, duration, releaseYear, getId());
    }

    @Override
    public boolean borrow(String borrowerId) {
        return super.borrow(borrowerId, LOAN_PERIOD);
    }

    // DVD特有方法
    public String getDirector() { return director; }
    public int getDuration() { return duration; }
    public int getReleaseYear() { return releaseYear; }
}
